import pandas as pd
import numpy as np
pstore = pd.read_csv("googleplaystore.csv")
pstore.head(10)
| App | Category | Rating | Reviews | Size | Installs | Type | Price | Content Rating | Genres | Last Updated | Current Ver | Android Ver | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0 | Photo Editor & Candy Camera & Grid & ScrapBook | ART_AND_DESIGN | 4.1 | 159 | 19M | 10,000+ | Free | 0 | Everyone | Art & Design | January 7, 2018 | 1.0.0 | 4.0.3 and up |
| 1 | Coloring book moana | ART_AND_DESIGN | 3.9 | 967 | 14M | 500,000+ | Free | 0 | Everyone | Art & Design;Pretend Play | January 15, 2018 | 2.0.0 | 4.0.3 and up |
| 2 | U Launcher Lite – FREE Live Cool Themes, Hide ... | ART_AND_DESIGN | 4.7 | 87510 | 8.7M | 5,000,000+ | Free | 0 | Everyone | Art & Design | August 1, 2018 | 1.2.4 | 4.0.3 and up |
| 3 | Sketch - Draw & Paint | ART_AND_DESIGN | 4.5 | 215644 | 25M | 50,000,000+ | Free | 0 | Teen | Art & Design | June 8, 2018 | Varies with device | 4.2 and up |
| 4 | Pixel Draw - Number Art Coloring Book | ART_AND_DESIGN | 4.3 | 967 | 2.8M | 100,000+ | Free | 0 | Everyone | Art & Design;Creativity | June 20, 2018 | 1.1 | 4.4 and up |
| 5 | Paper flowers instructions | ART_AND_DESIGN | 4.4 | 167 | 5.6M | 50,000+ | Free | 0 | Everyone | Art & Design | March 26, 2017 | 1.0 | 2.3 and up |
| 6 | Smoke Effect Photo Maker - Smoke Editor | ART_AND_DESIGN | 3.8 | 178 | 19M | 50,000+ | Free | 0 | Everyone | Art & Design | April 26, 2018 | 1.1 | 4.0.3 and up |
| 7 | Infinite Painter | ART_AND_DESIGN | 4.1 | 36815 | 29M | 1,000,000+ | Free | 0 | Everyone | Art & Design | June 14, 2018 | 6.1.61.1 | 4.2 and up |
| 8 | Garden Coloring Book | ART_AND_DESIGN | 4.4 | 13791 | 33M | 1,000,000+ | Free | 0 | Everyone | Art & Design | September 20, 2017 | 2.9.2 | 3.0 and up |
| 9 | Kids Paint Free - Drawing Fun | ART_AND_DESIGN | 4.7 | 121 | 3.1M | 10,000+ | Free | 0 | Everyone | Art & Design;Creativity | July 3, 2018 | 2.8 | 4.0.3 and up |
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
#Create a distribution plot for rating
sns.distplot(pstore.Rating)
plt.show()
C:\Users\super\AppData\Local\Programs\Python\Python39\lib\site-packages\seaborn\distributions.py:2557: FutureWarning: `distplot` is a deprecated function and will be removed in a future version. Please adapt your code to use either `displot` (a figure-level function with similar flexibility) or `histplot` (an axes-level function for histograms). warnings.warn(msg, FutureWarning)
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
#Create a distribution plot for rating
sns.distplot(pstore.Rating, bins=20, color="g")
plt.title("Distribution of app ratings", fontsize=20, color = 'red')
plt.show()
C:\Users\super\AppData\Local\Programs\Python\Python39\lib\site-packages\seaborn\distributions.py:2557: FutureWarning: `distplot` is a deprecated function and will be removed in a future version. Please adapt your code to use either `displot` (a figure-level function with similar flexibility) or `histplot` (an axes-level function for histograms). warnings.warn(msg, FutureWarning)
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
#Adding dark background to the graph
plt.style.use("dark_background")
#Create a distribution plot for rating
sns.distplot(pstore.Rating, bins=20, color="g")
plt.title("Distribution of app ratings", fontsize=20, color = 'red')
plt.show()
C:\Users\super\AppData\Local\Programs\Python\Python39\lib\site-packages\seaborn\distributions.py:2557: FutureWarning: `distplot` is a deprecated function and will be removed in a future version. Please adapt your code to use either `displot` (a figure-level function with similar flexibility) or `histplot` (an axes-level function for histograms). warnings.warn(msg, FutureWarning)
pstore['Content Rating'].value_counts()
Everyone 8714 Teen 1208 Mature 17+ 499 Everyone 10+ 414 Adults only 18+ 3 Unrated 2 Name: Content Rating, dtype: int64
#Remove the rows with values which are less represented
pstore = pstore[~pstore['Content Rating'].isin(["Adults only 18+","Unrated"])]
#Resetting the index
pstore.reset_index(inplace=True, drop=True)
#Analyzing the Content Rating column again
pstore['Content Rating'].value_counts()
Everyone 8714 Teen 1208 Mature 17+ 499 Everyone 10+ 414 Name: Content Rating, dtype: int64
plt.figure(figsize=[9,7])
pstore['Content Rating'].value_counts().plot.pie()
plt.show()
plt.figure(figsize=[9,7])
pstore['Content Rating'].value_counts().plot.barh()
plt.show()
sns.jointplot(pstore.Size, pstore.Rating)
plt.show()
C:\Users\super\AppData\Local\Programs\Python\Python39\lib\site-packages\seaborn\_decorators.py:36: FutureWarning: Pass the following variables as keyword args: x, y. From version 0.12, the only valid positional argument will be `data`, and passing other arguments without an explicit keyword will result in an error or misinterpretation. warnings.warn(
sns.jointplot(pstore.Size, pstore.Rating, kind = "reg")
plt.show()
C:\Users\super\AppData\Local\Programs\Python\Python39\lib\site-packages\seaborn\_decorators.py:36: FutureWarning: Pass the following variables as keyword args: x, y. From version 0.12, the only valid positional argument will be `data`, and passing other arguments without an explicit keyword will result in an error or misinterpretation. warnings.warn(
--------------------------------------------------------------------------- UFuncTypeError Traceback (most recent call last) ~\AppData\Local\Temp/ipykernel_18976/893023898.py in <module> ----> 1 sns.jointplot(pstore.Size, pstore.Rating, kind = "reg") 2 plt.show() ~\AppData\Local\Programs\Python\Python39\lib\site-packages\seaborn\_decorators.py in inner_f(*args, **kwargs) 44 ) 45 kwargs.update({k: arg for k, arg in zip(sig.parameters, args)}) ---> 46 return f(**kwargs) 47 return inner_f 48 ~\AppData\Local\Programs\Python\Python39\lib\site-packages\seaborn\axisgrid.py in jointplot(x, y, data, kind, color, height, ratio, space, dropna, xlim, ylim, marginal_ticks, joint_kws, marginal_kws, hue, palette, hue_order, hue_norm, **kwargs) 2200 2201 joint_kws.setdefault("color", color) -> 2202 grid.plot_joint(regplot, **joint_kws) 2203 2204 elif kind.startswith("resid"): ~\AppData\Local\Programs\Python\Python39\lib\site-packages\seaborn\axisgrid.py in plot_joint(self, func, **kwargs) 1732 1733 if str(func.__module__).startswith("seaborn"): -> 1734 func(x=self.x, y=self.y, **kwargs) 1735 else: 1736 func(self.x, self.y, **kwargs) ~\AppData\Local\Programs\Python\Python39\lib\site-packages\seaborn\_decorators.py in inner_f(*args, **kwargs) 44 ) 45 kwargs.update({k: arg for k, arg in zip(sig.parameters, args)}) ---> 46 return f(**kwargs) 47 return inner_f 48 ~\AppData\Local\Programs\Python\Python39\lib\site-packages\seaborn\regression.py in regplot(x, y, data, x_estimator, x_bins, x_ci, scatter, fit_reg, ci, n_boot, units, seed, order, logistic, lowess, robust, logx, x_partial, y_partial, truncate, dropna, x_jitter, y_jitter, label, color, marker, scatter_kws, line_kws, ax) 836 scatter_kws["marker"] = marker 837 line_kws = {} if line_kws is None else copy.copy(line_kws) --> 838 plotter.plot(ax, scatter_kws, line_kws) 839 return ax 840 ~\AppData\Local\Programs\Python\Python39\lib\site-packages\seaborn\regression.py in plot(self, ax, scatter_kws, line_kws) 368 369 if self.fit_reg: --> 370 self.lineplot(ax, line_kws) 371 372 # Label the axes ~\AppData\Local\Programs\Python\Python39\lib\site-packages\seaborn\regression.py in lineplot(self, ax, kws) 411 """Draw the model.""" 412 # Fit the regression model --> 413 grid, yhat, err_bands = self.fit_regression(ax) 414 edges = grid[0], grid[-1] 415 ~\AppData\Local\Programs\Python\Python39\lib\site-packages\seaborn\regression.py in fit_regression(self, ax, x_range, grid) 199 else: 200 x_min, x_max = ax.get_xlim() --> 201 grid = np.linspace(x_min, x_max, 100) 202 ci = self.ci 203 <__array_function__ internals> in linspace(*args, **kwargs) ~\AppData\Local\Programs\Python\Python39\lib\site-packages\numpy\core\function_base.py in linspace(start, stop, num, endpoint, retstep, dtype, axis) 125 # Convert float/complex array scalars to float, gh-3504 126 # and make sure one can use variables that have an __array_interface__, gh-6634 --> 127 start = asanyarray(start) * 1.0 128 stop = asanyarray(stop) * 1.0 129 UFuncTypeError: ufunc 'multiply' did not contain a loop with signature matching types (dtype('<U6'), dtype('float64')) -> None
sns.pairplot(pstore[['Reviews', 'Size', 'Price','Rating']])
plt.show()